//
//  CustomTableViewCell.m
//  UITableView提高用户体验
//
//  Created by 青梅睿创公司 on 2018/2/12.
//  Copyright © 2018年 青梅睿创公司. All rights reserved.
//

#import "CustomTableViewCell.h"

@implementation CustomTableViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    //    NSString * ID;    // 在执行的时候才能确定
    static NSString * cellID = @"cellID";
    id cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[self alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
    }
    
    return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUpChildControl];
    }
    return self;
}
- (void)setUpChildControl{
//    self.selectionStyle = UITableViewCellSelectionStyleNone;
    UIImageView * picView = [[UIImageView alloc] init];
    picView.contentMode = UIViewContentModeScaleAspectFill;
    picView.clipsToBounds = YES;
    [self addSubview:picView];
    picView.frame = CGRectMake(10, self.frame.origin.y + 10, 100, 50);
    picView.backgroundColor = [UIColor redColor];
    _picView = picView;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
